package com.yuexunit.finance.project.entity.lexicon;

import com.yuexunit.util.DateUtil;

/**
 * @author zeng hui wu 2015年10月19日
 */
public enum FinanceStateEnum {

	CANCEL("已取消"), APPROVE("审批中"), WAIT_CONFIRM("待确认"), APPROVED("已审批"), APPROVE_NOPASS("审批不通过"), CONTRACT_SIGN("协议已签订"), WAIT_INSPECTION("待验货"), INSPECTIONED("已验货"), WAIT_LOAN("待放款"), LOANED("已放款"), PICKUP_APPROVE("提货审批中"), PICKUP_APPROVE_NOPASS(
			"提货审批不通过"), EXCHANGE_APPROVE("换货审批中"), EXCHANGE_APPROVE_NOPASS("换货审批不通过"), PICKUP_APPROVED("提货已审批"), WAIT_PUTGOOD("待放货"), PUTGOOD("放货中"), SIGN("已签收"), FINISH("已完成"), EVALUATE("已评价"), UNSUMIT("待提交"), FIRSTCOMPLETE("初审通过"), WAIT_PROTOCOL("待签订合同"), WAIT_APPROVE("待正审"),CUSTOMER_DOCUMENT("待客户签署合同"),PICKUP_APPROVE_WAREHOUSE("提货审批中"),PART_REPAYMENTS("部分还款"),REPAYMENTS("已结清"),PICKUP_APPROVE_WAREHOUSE_REJECT("提货审批拒绝"),PICKUP_APPROVE_WAREHOUSE_CANCEL("提货取消"),PICKUP_APPROVE_WAREHOUSE_FINISHED("已完成"),SUPPLEMENT_CONTRACT("待增补合同");

	private final String paramType;

	private FinanceStateEnum(String paramType) {
		this.paramType = paramType;
	}

	public String getValue() {
		return paramType;
	}

	/**
	 * 数字转为枚举类型
	 * @param value 
	 *            0:已取消/1:审批中/2:待确认/3:已审批/4:审批不通过/5:合同已签订/6:待验货/7:已验货/8:待放款/9:已放款/10:提货审批中/11:提货审批不通过/12:换货审批中/13:换货审批不通过/14:提货已审批/15:待放货/16:放货中/17:已签收/18:已完成/19:已评价/20:待提交/21:初审通过/22:待签订协议/23:待正审/24:待客户签署合同/25:提货审批中/26:部分还款/27:已还款/28:提货审批拒绝/29:提货取消/30:已完成/31:待增补合同
	 * @return 参数类型枚举
	 */
	public static FinanceStateEnum valueOf(Integer value) {
		if (value == null || values().length <= value.intValue()) {
			
			
			
			return CANCEL;
		}
		return values()[value.intValue()];
	}

	public static void main(String[] args) {
		System.out.println(DateUtil.nextDay(DateUtil.thatDay(DateUtil.now())).getTime()-DateUtil.now().getTime());
	}
}
